#ifndef __KEY_NODELAY_H
#define __KEY_NODELAY_H

#include "stm32f1xx_hal.h"
#include "stm32f1xx_hal_gpio.h"


#define KEY_MAX_DELAY 12

typedef struct 
{
	uint8_t flag;			//按下标志， 1为空闲， 0为按下
	uint8_t Key_cnt;//累计循环次数
}Key_State;

typedef struct
{
	Key_State key_sta;
	uint32_t GPIO_PIN;
	GPIO_TypeDef * Key_GPIOx;
}Key_Handler;

void Key_Init(Key_Handler* hkey);
uint8_t KeyScan(Key_Handler* hkey);

#endif
